local skill = fk.CreateSkill {
  name = "lq_dye_skill",
}

skill:addEffect("cardskill", {
  prompt = "#lq_dye_skill",
  target_num = 1,
  mod_target_filter = function(self, player, to_select, selected, card)
    return to_select ~= player
  end,
  target_filter = Util.CardTargetFilter,
  on_effect = function(self, room, effect)
    local player = effect.from
    local target = effect.to
    local id1, id2
    if player:isAlive() then
      id1 = player:drawCards(1, self.name)[1]
    end
    if target:isAlive() then
      id2 = target:drawCards(1, self.name)[1]
    end
    if id1 and id2 and Fk:getCardById(id1).type == Fk:getCardById(id2).type then
      if target:isAlive() then
        room:loseHp(target, 1, self.name)
      end
      if player:isAlive() then
        room:recover { num = 1, skillName = self.name, who = player, recoverBy = player }
      end
    end
  end,
})

Fk:loadTranslationTable{
  ["lq_dye_skill"] = "染",
  ["#lq_dye_skill"] = "与一名其他角色各摸一张牌，若摸到的牌类型相同，你吸取其一点体力",
}

return skill
